<?php
namespace Admin\Controller;
use Think\Controller;
use Admin\Model\UserModel;
/**
* 用户类
*/
class UserController extends Controller {
	private $userModel;
	public function __construct(){
		parent::__construct();
		$this->userModel=new UserModel();
	}
    public function login(){
    	var_dump(IS_GET);
    	if(IS_POST){
    		$res=$this->userModel->login();
			if($res['valid']){
//				return json(['valid'=>1,'message'=>'欢迎'.input('post.username').'登录']);
//				echo 1;
			}else{
//				return json(['valid'=>0,'message'=>$res]);
//				echo $res['message'];
			}
//			return;
    	}
    	$this->display();
    }
}